//
//  RBDefine.h
//  基本结构
//
//  Created by 蓝其 on 16/10/20.
//  Copyright © 2016年 蓝其. All rights reserved.
//

#import <UIKit/UIKit.h>
#import "RBScrollViewDefine.h"
#import "RBTableViewDefine.h"
#import "RBCollectionViewDefine.h"
#import "RBViewControllerDefine.h"
#import "RanTool.h"
#import "RBConst.h"
#import "RBAccountManager.h"
#pragma mark - 屏幕尺寸
#define kRBMainScreenBounds [UIScreen mainScreen].bounds
#define kRBMainScreenSize kRBMainScreenBounds.size
#define kRBMainScreenWidth kRBMainScreenSize.width
#define kRBMainScreenHeight kRBMainScreenSize.height

#pragma mark - 屏幕控件高度
#define kRBStatusBarHeight [UIApplication sharedApplication].statusBarFrame.size.height
#define kRBNavigationBarHeight self.navigationController.navigationBar.bounds.size.height
#define kRBTabBarHeight self.tabBarController.tabBar.bounds.size.height

#pragma mark - 屏幕适配
#define kRBShortScreen (kRBMainScreenHeight/kRBMainScreenWidth < 3.1/2)
#define kRBSafeBottomHeight [RanTool safeBottomHeight]
#define kRBiPhoneXTabbarHeight (kRBSafeBottomHeight + 49.0)
#define kRBFactor (kRBMainScreenWidth/375.0) //UI图调成750后统一对比
#define kRBZoom(value) (kRBFactor*(value))
#define Zoom(value) kRBZoom(value)

#pragma mark - 忽略自动调整后view的y和height建议值(height不包括iPhoneX安全区)
#define kRBViewYInController (self.navigationController.navigationBar.translucent? kRBStatusBarHeight + kRBNavigationBarHeight: 0)
#define kRBViewHeightInController (kRBMainScreenHeight - kRBStatusBarHeight - kRBNavigationBarHeight - kRBTabBarHeight)

#pragma mark - 通用调整
#define kRBViewControllerCommonAdjust {kRBIgnoreAutoInsetsAdjust;kRBRemoveBackTitle}
#define kRBTableViewCommentAdjust(tableView) kRBIgnoreScrollViewInsetsAdjust(tableView);\

#pragma mark - Nib
#define kRBTableViewResigterNib(tableView, cellName, reuseId) [tableView registerNib:[UINib nibWithNibName:cellName bundle:nil] forCellReuseIdentifier:reuseId];
#define kRBGetViewFromNib(viewName) [[NSBundle mainBundle] loadNibNamed:viewName owner:nil options:nil].lastObject;

#pragma mark - Block
#define kRBWeakSelf __weak typeof(self) weak_self = self;
#define kRBStrongSelf __strong typeof(weak_self) strong_self = weak_self;

#pragma mark - 输入校验字符
#define kRBMobileReg @"^1((3[0-9]|4[57]|5[0-35-9]|7[0678]|8[0-9])\\d{8}$)"
#define kRBPasswordSet @"1234567890qwertyuiopasdfghjklzxcvbnmQWERTYUIOPASDFGHJKLZXCVBNM|,./;:[]{}`~!@#$%^*()_+-=?"
#define kRBNumberSet @"1234567890"

#pragma mark - 正则
#define kRBReg(regString,data) [RanTool regWithRegString: regString string: data]
#define kRBFillNum(subMobile) [RanTool fillNumString:subMobile]

#pragma mark - 数字键盘
#define kRBNumPadMode UIKeyboardTypeNumberPad

#pragma mark - 防止字符串nil引发崩溃
#define kRBNotNilString(text) [RanTool notNilString:text]



